@import 'normalize.scss';

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: normal;
  src: url(../assets/fonts/Roboto-Regular.ttf) format('truetype');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  src: url(../assets/fonts/Roboto-Bold.ttf) format('truetype');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 900;
  src: url(../assets/fonts/Roboto-Black.ttf) format('truetype');
}
@font-face {
  font-family: 'Roboto';
  font-style: italic;
  font-weight: normal;
  src: url(../assets/fonts/Roboto-Italic.ttf) format('truetype');
}
@font-face {
  font-family: 'Roboto';
  font-style: italic;
  font-weight: 700;
  src: url(../assets/fonts/Roboto-BoldItalic.ttf) format('truetype');
}
@font-face {
  font-family: 'Roboto';
  font-style: italic;
  font-weight: 900;
  src: url(../assets/fonts/Roboto-BlackItalic.ttf) format('truetype');
}

$font: Roboto, -apple-system, BlinkMacSystemFont, PingFang SC, Hiragino Sans GB, Helvetica Neue,
  Helvetica, Arial, sans-serif;

body {
  padding: 0;
  margin: 0;
  color: var(--el-text-color-primary);
  font-size: 14px;
  font-family: $font;
}

a {
  color: var(--el-color-primary);
  text-decoration: none;
  background-color: transparent;
  outline: none;
  cursor: pointer;
  -webkit-transition: color 0.3s;
  transition: color 0.3s;
}

textarea,
code {
  font-family: $font;
}

#app {
  min-width: 600px;
  margin: 0 auto;
}

#nprogress {
  .bar {
    background: var(--el-color-primary);
  }
}

.app-wrapper {
  padding: 20px;
}
.app-wrapper-compact {
  padding: 15px 10px;
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar:horizontal {
  height: 6px;
}
::-webkit-scrollbar-track {
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background-color: #0003;
  border-radius: 10px;
  transition: all 0.2s ease-in-out;
}
::-webkit-scrollbar-thumb:hover {
  cursor: pointer;
  background-color: #0000004d;
}

.search-wrapper {
  .el-button {
    margin-left: 12px;
  }
  & > .el-col {
    margin-bottom: 20px;
  }
  .el-select {
    width: 100%;
  }
  .el-date-editor {
    width: 100%;
  }
}

.emq-table-footer {
  margin-top: 30px;
  text-align: right;
}

.emq-title {
  font-size: 16px;
  color: #333333;
  font-weight: bolder;
  margin-bottom: 40px;

  .sub-title {
    font-weight: normal;
    display: block;
    font-size: 12px;
    color: #8f9297;
    margin-top: 12px;
  }
}

.page-header-title {
  font-size: 24px;
  color: #1d1d1d;
  font-weight: 600;
  margin-bottom: 24px;
}

.field-info {
  margin: 0;
  list-style: none;
  padding: 3px 0;
  line-height: 35px;

  .field-title {
    display: inline-block;
    font-style: normal;
    font-size: 14px;
    color: #999;
    padding-right: 16px;
  }

  .field-value {
    font-size: 14px;
    color: #101010;
  }
}

// Text-aligin button group
.button-group {
  margin-top: 24px;
  &__center {
    text-align: center;
  }
  &__right {
    text-align: right;
  }
}

.iconx {
  display: inline-block;
  width: 24px;
  height: 24px;
  font-style: normal;
  background-image: url('~@/assets/img/iconset@2x.png');
  background-size: 153px 159px;
  background-repeat: no-repeat;
  vertical-align: middle;
  //24*24 each
  $icon-size: -24px;
  @mixin use-icon($x, $y) {
    background-position: $icon-size * $x $icon-size * $y;
  }
  &.icon-alarm {
    @include use-icon(5, 1);
  }
  &.icon-globe {
    @include use-icon(4, 1);
  }
  &.icon-monitor {
    @include use-icon(1, 3);
  }
  &.icon-cards {
    @include use-icon(5, 2);
  }
  &.icon-lists {
    @include use-icon(0, 3);
  }
  &.icon-sweep {
    @include use-icon(3, 2);
  }
  &.icon-monitoring {
    @include use-icon(0, 0);
  }
  &.icon-management {
    @include use-icon(1, 0);
  }
  &.icon-authentication {
    @include use-icon(2, 0);
  }
  &.icon-configuration {
    @include use-icon(0, 1);
  }
  &.icon-system {
    @include use-icon(1, 1);
  }
  &.icon-ruleengine {
    @include use-icon(3, 0);
  }
  &.icon-diagnose {
    @include use-icon(2, 3);
  }
  &.icon-plugin {
    @include use-icon(5, 0);
  }
}

.g-coap::before {
  background-image: url('~@/assets/gateway/coap.png');
}
.g-lwm2m::before {
  background-image: url('~@/assets/gateway/lwm2m.png');
}
.g-mqttsn::before {
  background-image: url('~@/assets/gateway/mqttsn.png');
}
.g-stomp::before {
  background-image: url('~@/assets/gateway/stomp.png');
}
.g-tcp::before {
  background-image: url('~@/assets/gateway/tcp.png');
}
.g-exproto::before {
  background-image: url('~@/assets/gateway/exproto.png');
}

.section-header {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  &:not(:first-of-type) {
    margin-top: 40px;
  }

  & .section-desc {
    font-size: 14px;
    font-weight: normal;
    color: #999;
    margin: 5px 0;
  }

  & > :first-child {
    flex-grow: 1;
    overflow: hidden;
  }

  & > :not(:first-child) {
    margin-left: 10px;
  }

  span,
  i {
    vertical-align: middle;
  }

  & + .el-menu {
    margin: -20px 0 20px;
  }

  .title-n-status {
    display: inline-flex;
    flex-direction: column;
    margin-left: 10px;
    height: 45px;
  }

  .section-title {
    font-size: 14px;
    font-weight: 700;
    flex-grow: 1;
  }
  .section-status {
    height: 18px;
    border-radius: 8px;
  }

  .el-tag.el-tag--info {
    line-height: 18px;
    height: 20px;

    .status {
      width: 10px;
      height: 10px;
      display: inline-block;
      background-color: #00b173;
      border-radius: 5px;
      margin-right: 4px;

      &.stopped {
        background-color: var(--el-color-danger);
      }
    }
  }
}

// .section-addition {
// }

.part-header {
  font-size: 16px;
  font-weight: 700;

  &:not(:first-of-type) {
    margin-top: 30px;
  }
}

.no-dropdown-arrow {
  .popper__arrow {
    display: none;
  }
}

.el-input-group--append .el-input-group__append {
  width: 120px;
  padding: 0;

  .el-select {
    margin: -10px 0;
  }
}

.el-button--small.link-btn {
  padding: 0;
  a {
    display: flex;
    align-items: center;
    padding: 9px 15px;
    color: inherit;
  }
}

.back-button {
  color: #96999c;
  &::before {
    content: '<';
    margin-right: 8px;
  }
  display: inline-block;
  margin-bottom: 20px;
}

.el-date-editor {
  --el-date-editor-datetimerange-width: 100%;
}

/* El Radio */
.el-radio-button__original-radio:checked + .el-radio-button__inner {
  background: rgba(0, 178, 153, 0.05);
  color: #00b299;
}

.text-status {
  &.success {
    color: var(--el-color-success);
  }
  &.danger {
    color: var(--el-color-danger);
  }
}

/* El Popper */
.el-popper.is-dark {
  background: #282e38;

  &.tooltip-node-status-list {
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .node-status-list {
    margin-top: 0;
    margin-bottom: 0;
    list-style: none;
    padding-left: 0;
    width: 200px;
  }

  .node-status-item {
    display: flex;
    justify-content: space-between;
    margin: 12px 0;
    .text-status {
      flex-shrink: 0;
      margin-right: 20px;
    }
    .node-name {
      word-break: break-all;
    }
  }
}

/* El Select TODO:delete it after upgrade element-plus */
.el-select .el-input .el-input__suffix .el-input__validateIcon {
  display: none;
}

.form-item-desc {
  margin-left: 4px;
  font-size: 14px;
  cursor: pointer;
}

.form-item-desc-popper {
  width: 300px;
}
